package jp.co.libgate.meta;

//@javax.annotation.Generated(value = { "slim3-gen", "@VERSION@" }, date = "2012-06-23 15:12:37")
/** */
public final class AttendMeta extends org.slim3.datastore.ModelMeta<jp.co.libgate.model.Attend> {

    /** */
    public final org.slim3.datastore.StringAttributeMeta<jp.co.libgate.model.Attend> id = new org.slim3.datastore.StringAttributeMeta<jp.co.libgate.model.Attend>(this, "id", "id");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<jp.co.libgate.model.Attend> inlat = new org.slim3.datastore.StringAttributeMeta<jp.co.libgate.model.Attend>(this, "inlat", "inlat");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<jp.co.libgate.model.Attend> inlon = new org.slim3.datastore.StringAttributeMeta<jp.co.libgate.model.Attend>(this, "inlon", "inlon");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<jp.co.libgate.model.Attend> intime = new org.slim3.datastore.StringAttributeMeta<jp.co.libgate.model.Attend>(this, "intime", "intime");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<jp.co.libgate.model.Attend, com.google.appengine.api.datastore.Key> key = new org.slim3.datastore.CoreAttributeMeta<jp.co.libgate.model.Attend, com.google.appengine.api.datastore.Key>(this, "__key__", "key", com.google.appengine.api.datastore.Key.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<jp.co.libgate.model.Attend> outlat = new org.slim3.datastore.StringAttributeMeta<jp.co.libgate.model.Attend>(this, "outlat", "outlat");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<jp.co.libgate.model.Attend> outlon = new org.slim3.datastore.StringAttributeMeta<jp.co.libgate.model.Attend>(this, "outlon", "outlon");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<jp.co.libgate.model.Attend> outtime = new org.slim3.datastore.StringAttributeMeta<jp.co.libgate.model.Attend>(this, "outtime", "outtime");

    private static final AttendMeta slim3_singleton = new AttendMeta();

    /**
     * @return the singleton
     */
    public static AttendMeta get() {
       return slim3_singleton;
    }

    /** */
    public AttendMeta() {
        super("Attend", jp.co.libgate.model.Attend.class);
    }

    @Override
    public jp.co.libgate.model.Attend entityToModel(com.google.appengine.api.datastore.Entity entity) {
        jp.co.libgate.model.Attend model = new jp.co.libgate.model.Attend();
        model.setId((java.lang.String) entity.getProperty("id"));
        model.setInlat((java.lang.String) entity.getProperty("inlat"));
        model.setInlon((java.lang.String) entity.getProperty("inlon"));
        model.setIntime((java.lang.String) entity.getProperty("intime"));
        model.setKey(entity.getKey());
        model.setOutlat((java.lang.String) entity.getProperty("outlat"));
        model.setOutlon((java.lang.String) entity.getProperty("outlon"));
        model.setOuttime((java.lang.String) entity.getProperty("outtime"));
        return model;
    }

    @Override
    public com.google.appengine.api.datastore.Entity modelToEntity(java.lang.Object model) {
        jp.co.libgate.model.Attend m = (jp.co.libgate.model.Attend) model;
        com.google.appengine.api.datastore.Entity entity = null;
        if (m.getKey() != null) {
            entity = new com.google.appengine.api.datastore.Entity(m.getKey());
        } else {
            entity = new com.google.appengine.api.datastore.Entity(kind);
        }
        entity.setProperty("id", m.getId());
        entity.setProperty("inlat", m.getInlat());
        entity.setProperty("inlon", m.getInlon());
        entity.setProperty("intime", m.getIntime());
        entity.setProperty("outlat", m.getOutlat());
        entity.setProperty("outlon", m.getOutlon());
        entity.setProperty("outtime", m.getOuttime());
        entity.setProperty("slim3.schemaVersion", 1);
        return entity;
    }

    @Override
    protected com.google.appengine.api.datastore.Key getKey(Object model) {
        jp.co.libgate.model.Attend m = (jp.co.libgate.model.Attend) model;
        return m.getKey();
    }

    @Override
    protected void setKey(Object model, com.google.appengine.api.datastore.Key key) {
        validateKey(key);
        jp.co.libgate.model.Attend m = (jp.co.libgate.model.Attend) model;
        m.setKey(key);
    }

    @Override
    protected long getVersion(Object model) {
        throw new IllegalStateException("The version property of the model(jp.co.libgate.model.Attend) is not defined.");
    }

    @Override
    protected void assignKeyToModelRefIfNecessary(com.google.appengine.api.datastore.AsyncDatastoreService ds, java.lang.Object model) {
    }

    @Override
    protected void incrementVersion(Object model) {
    }

    @Override
    protected void prePut(Object model) {
    }

    @Override
    public String getSchemaVersionName() {
        return "slim3.schemaVersion";
    }

    @Override
    public String getClassHierarchyListName() {
        return "slim3.classHierarchyList";
    }

    @Override
    protected boolean isCipherProperty(String propertyName) {
        return false;
    }

    @Override
    protected void modelToJson(org.slim3.datastore.json.JsonWriter writer, java.lang.Object model, int maxDepth, int currentDepth) {
        jp.co.libgate.model.Attend m = (jp.co.libgate.model.Attend) model;
        writer.beginObject();
        org.slim3.datastore.json.JsonCoder encoder = null;
        if(m.getId() != null){
            writer.setNextPropertyName("id");
            encoder = new org.slim3.datastore.json.Default();
            encoder.encode(writer, m.getId());
        }
        if(m.getInlat() != null){
            writer.setNextPropertyName("inlat");
            encoder = new org.slim3.datastore.json.Default();
            encoder.encode(writer, m.getInlat());
        }
        if(m.getInlon() != null){
            writer.setNextPropertyName("inlon");
            encoder = new org.slim3.datastore.json.Default();
            encoder.encode(writer, m.getInlon());
        }
        if(m.getIntime() != null){
            writer.setNextPropertyName("intime");
            encoder = new org.slim3.datastore.json.Default();
            encoder.encode(writer, m.getIntime());
        }
        if(m.getKey() != null){
            writer.setNextPropertyName("key");
            encoder = new org.slim3.datastore.json.Default();
            encoder.encode(writer, m.getKey());
        }
        if(m.getOutlat() != null){
            writer.setNextPropertyName("outlat");
            encoder = new org.slim3.datastore.json.Default();
            encoder.encode(writer, m.getOutlat());
        }
        if(m.getOutlon() != null){
            writer.setNextPropertyName("outlon");
            encoder = new org.slim3.datastore.json.Default();
            encoder.encode(writer, m.getOutlon());
        }
        if(m.getOuttime() != null){
            writer.setNextPropertyName("outtime");
            encoder = new org.slim3.datastore.json.Default();
            encoder.encode(writer, m.getOuttime());
        }
        writer.endObject();
    }

    @Override
    protected jp.co.libgate.model.Attend jsonToModel(org.slim3.datastore.json.JsonRootReader rootReader, int maxDepth, int currentDepth) {
        jp.co.libgate.model.Attend m = new jp.co.libgate.model.Attend();
        org.slim3.datastore.json.JsonReader reader = null;
        org.slim3.datastore.json.JsonCoder decoder = null;
        reader = rootReader.newObjectReader("id");
        decoder = new org.slim3.datastore.json.Default();
        m.setId(decoder.decode(reader, m.getId()));
        reader = rootReader.newObjectReader("inlat");
        decoder = new org.slim3.datastore.json.Default();
        m.setInlat(decoder.decode(reader, m.getInlat()));
        reader = rootReader.newObjectReader("inlon");
        decoder = new org.slim3.datastore.json.Default();
        m.setInlon(decoder.decode(reader, m.getInlon()));
        reader = rootReader.newObjectReader("intime");
        decoder = new org.slim3.datastore.json.Default();
        m.setIntime(decoder.decode(reader, m.getIntime()));
        reader = rootReader.newObjectReader("key");
        decoder = new org.slim3.datastore.json.Default();
        m.setKey(decoder.decode(reader, m.getKey()));
        reader = rootReader.newObjectReader("outlat");
        decoder = new org.slim3.datastore.json.Default();
        m.setOutlat(decoder.decode(reader, m.getOutlat()));
        reader = rootReader.newObjectReader("outlon");
        decoder = new org.slim3.datastore.json.Default();
        m.setOutlon(decoder.decode(reader, m.getOutlon()));
        reader = rootReader.newObjectReader("outtime");
        decoder = new org.slim3.datastore.json.Default();
        m.setOuttime(decoder.decode(reader, m.getOuttime()));
        return m;
    }
}